<template>
	<view class="container">
		<nav-bar title="乘车须知" :showBack="true"></nav-bar>
		<view class="statement" v-if="statement">
			<text class="title">{{ statement.title }}</text>
			<rich-text class="content" :nodes="statement.content"></rich-text>
		</view>
	</view>
</template>

<script>
	import {
		getStatement
	} from '@/api/metro.js'
	export default {
		data() {
			return {
				statement: null
			}
		},
		onLoad() {
			this.getStatement(1);
		},
		methods: {
			// 获取声明
			getStatement(type) {
				const _that = this;
				getStatement(type)
					.then((res) => {
						_that.statement = res.data;
					})
			}
		}
	}
</script>

<style lang="scss">
	.container {
		.statement {
			width: 100%;
			padding: 0.8rem 3%;
			overflow: hidden;
			box-sizing: border-box;
			background-color: $uni-bg-color;

			.title {
				font-size: 1.2rem;
				line-height: 3rem;
				display: block;
				border-bottom: 1rpx solid #dedede;
				margin-bottom: 0.8rem;
			}

			.content {}
		}
	}
</style>
